<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增友情链接')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-link-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">链接地址：</label>
                <div class="col-sm-8">
                    <input name="linkUrl" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">链接名：</label>
                <div class="col-sm-8">
                    <input name="linkName" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">链接介绍：</label>
                <div class="col-sm-8">
                    <input name="linkSuggest" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">分组key：</label>
                <div class="col-sm-8">
                    <input name="groupKey" class="form-control"></input>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">分组名：</label>
                <div class="col-sm-8">
                    <input name="groupName" data-provide="typeahead"  class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">排序：</label>
                <div class="col-sm-8">
                    <input name="orderNum" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">链接LOGO：</label>
                <div class="col-sm-8">
                    <input name="linkFavicon" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
				<label class="col-sm-3 control-label">状态：</label>
				<div class="col-sm-8">
					<div class="col-sm-8">
						<div class="radio-box" th:each="dict : ${@dict.getType('cms_link_visible')}">
							<input type="radio" th:id="${dict.dictCode}"  name="visible" th:value="${dict.dictValue}" th:checked="${dict.default}">
							<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
						</div>
					</div>
				</div>
			</div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark"  class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-typeahead-js" />
    <script type="text/javascript" th:inline="javascript">
        var prefix = ctx + "cms/link"
        $("#form-link-add").validate({
            focusCleanup: true
        });
        $('input[name="groupName"]').typeahead({
            source: [[${groups}]]
        });
        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-link-add').serialize());
            }
        }
    </script>
</body>
</html>